//using DB;
using System;
using System.Data;
using System.Data.SqlClient;
using Autenticazione;

namespace BusinessObject
{
	public class Cintura
	{
		public int Id;
		public string Belt;
		public Cintura()
		{
		}
		public Cintura(int id, string belt)
		{
			this.Id = id;
			this.Belt = belt;
		}
		public DataTable GetTbBelts()
		{
			string strSQL = string.Format("select * from Belt order by Id", new object[0]);
            DB db = new DB();
			return db.GetTable(strSQL);
		}
		public string GetBeltDescription()
		{
			string description = string.Empty;
			string strSQL = string.Format("select * from Belt where Id = {0}", this.Id.ToString());
			DB db = new DB();
			SqlDataReader dr = db.Reader(strSQL);
			if (dr == null)
			{
				description = string.Empty;
			}
			if (dr.Read())
			{
				description = dr["Belt"].ToString();
			}
			db.CloseConnection();
			return description;
		}
	}
}
